import {get, post} from "@/utils/http";
import {requestFilter} from '@/utils/permiss'

// 获取登录验证码
export async function loginCode(params) {
    return await get('system/validateCode', params, {responseType: "arraybuffer"})
}

// 登录
export async function onLogin(params) {
    return await post('system/login', params)
}

// 获取菜单列表
export async function fetchMenuList(params) {
    return await get('permission/menuSearch', params)
}

//  添加菜单列表
export async function insertMenu(params) {
    return await post('permission/insert', params)
}

// 编辑菜单列表
export async function updateMenu(params) {
    return await post('permission/update', params)
}

// 删除菜单列表
export async function deleteMenu(params) {
    return await get('permission/delete', params)
}

// 切换菜单状态
export async function changeMenuStatus(params) {
    return await post('permission/updateStatus', params)
}

// 获取机构下拉
export async function selectInstitution(params) {
    return await get('institution/institutionName', params, {
        isFilter: true
    })
}
// 获取贷超app列表下拉
export async function selectProductList(params) {
    return await get('systemSettings/getAppList', params, )
}
// 获取系统员工
export async function selectSystemUser(params) {
    return await get('system/selectSystemUser', params, )
}
// 上传图片
export async function uploadImage(params) {
    return await post('product/upload', params)
}

// 获取产品下拉列表
export async function fetchProductSelect(params) {
    return await get('product/select', params, {
        isFilter: true
    })
}

// 退出登录
export async function outLogin(params) {
    return await get('/system/out', params)
}

// 当前登录用户重置密码
export async function updateResetPassword(params) {
    return await post('system/updatePassword', params)
}

// 用户列表重置密码
export async function userResetPassword(params) {
    return await get('system/resetPassword', params)
}
